home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 1159.ZIP / OSSCOM.PRG < prev    next >
Text File  |  1986-11-20  |  5KB  |  204 lines

  1. SELECT 5
  2. USE DATAOPTN
  3. GO VAL(NCHR)
  4. OSSDATE=OSSDAT
  5. USE
  6. DAT=DATE()
  7. SET SAFETY OFF
  8. N4='K'
  9. DO WHILE N4#'STOP'
  10. SELECT 1
  11. SET DELETED ON
  12. N99='Z'
  13. IF DAT<OSSDATE
  14.  SELECT 5
  15.  USE DATAOPTN
  16.  GO VAL(NCHR)
  17.  REPLACE OSSDAT WITH DAT
  18.  USE
  19.  SELECT 1
  20. ENDIF
  21. IF YEAR(DAT)*365.24+MONTH(DAT)*30.44+DAY(DAT)>YEAR(OSSDATE)*365.24;
  22. +MONTH(OSSDATE)*30.44+DAY(OSSDATE)+29.44
  23.  DO WHILE N99#'Y'.AND.N99#'N'
  24.   CLEAR
  25.   @ 4,0 SAY 'It is time for this data base to reorganize its information so;
  26.  that it may'
  27.   ?
  28.   ?'operate with greater speed and efficiency.  It will do this automatically;
  29.  at'
  30.   ?
  31.   ?'your command.  The problem is that it may take a few minutes to do this,;
  32.  and'
  33.   ?
  34.   ?'you will NOT be able to use the data base during those few minutes.'
  35.   ?
  36.   ?
  37.   ?'Do you wish to allow the data base to carry out the information ;
  38. reorganization'
  39.   ?
  40.   WAIT 'at this time ?  (Y/N) ' TO N99
  41.   N99=UPPER(N99)
  42.   IF N99='Y'
  43.    ?
  44.    ?
  45.    ?'                             WORKING . . .'
  46.    ?
  47.    ?
  48.    ?'          PLEASE DO NOT PRESS ANY KEYS DURING THIS PROCEDURE.'
  49.    USE &DBNAME INDEX &INDEX1,&INDEX2
  50.    PACK
  51.    SELECT 5
  52.    USE DATAOPTN
  53.    GO VAL(NCHR)
  54.    REPLACE OSSDAT WITH DAT
  55.    USE
  56.    OSSDATE=DAT
  57.    SELECT 1
  58.   ENDIF
  59.  ENDDO    
  60. ENDIF
  61. CLEAR
  62. @ 1,15 SAY 'Data base in use:  '
  63. ?? OSS
  64. DO WHILE ASC(N4)<65.OR.ASC(N4)>70
  65.  @ 3,0 CLEAR
  66. @ 3,7 SAY 'What would you like to do ?'
  67.  ?
  68.  ?'A)  Examine, print out, modify, or delete records through the use'
  69.  ?'    of ID codes.'
  70.  ??'  (By '
  71.  ?? TVANUMBER
  72.  ??' or by '
  73.  ?? SERIALNUM
  74.  ??')'
  75.  ?
  76.  ?'B)  Examine, print out, modify, or delete records many records at a time.'
  77.  ?
  78.  ?
  79.  ?'C)  Add records to this data base.'
  80.  ?
  81.  ?
  82.  ?'D)  Make a backup copy of all records in this data base.'
  83.  ?
  84.  ?
  85.  ?'E)  Restore records to the hard disk from a backup copy.'
  86.  ?
  87.  ?
  88.  ?'F)  QUIT (with backup copy option)'
  89.  ?
  90.  ?
  91.  ?'    Press "RETURN" to return to previous menu.'
  92.  WAIT '                          ' TO N4
  93.  ??'   WORKING . . .'
  94.  N4=UPPER(N4)
  95.  IF ASC(N4)=0
  96.   N4='Z'
  97.   RETURN
  98.  ENDIF
  99. ENDDO
  100. DO CASE
  101.  CASE N4='A'
  102.   DO OSSSEE
  103.  CASE N4='B'
  104.   DO OSSPREP
  105.  CASE N4='C'
  106.   DO OSSADD
  107.  CASE N4='D'
  108.     CLEAR
  109.     @ 5,0
  110.     ?'        This procedure copies all information for this data base FROM'
  111.     ?'        your fixed disk TO one or more floppy disks, depending on the'
  112.     ?'        size of this particular data base.  In the process of doing this,'
  113.     ?'        the data (if any) which is currently on the FLOPPY DISKETTE(S)'
  114.     ?'        may be destroyed.'
  115.     ?
  116.     ?'        Each data base which is backed up must be backed up on a separate'
  117.     ?'        floppy diskette (or a separate set of floppy diskettes).'  
  118.     ?
  119.     ?
  120.     ?
  121.     ?'        Please place a formatted floppy disk into drive "A" and'
  122.     ?
  123.     ?'        press any key other than "RETURN" to continue.  Press'
  124.     ?
  125.    WAIT '        "RETURN" to abort this procedure and return to the menu.' TO N6
  126.     IF ASC(N6)=0
  127.      N4='Z'
  128.      LOOP
  129.     ENDIF
  130.     N4='Z'
  131.     DO DATABACK
  132.     LOOP
  133.  CASE N4='F'
  134.   ?
  135.   ?
  136.   DO WHILE N4#'Y'.AND.N4#'N'
  137.   CLEAR
  138.     @ 5,0
  139.     ?'        This procedure copies all information for this data base FROM'
  140.     ?'        your fixed disk TO one or more floppy disks, depending on the'
  141.     ?'        size of this particular data base.  In the process of doing this,'
  142.     ?'        the data (if any) which is currently on the FLOPPY DISKETTE(S)'
  143.     ?'        may be destroyed.'
  144.     ?
  145.     ?'        Each data base which is backed up must be backed up on a separate'
  146.     ?'        floppy diskette (or a separate set of floppy diskettes).'  
  147.     ?
  148.     ?
  149. WAIT '        Do you wish to make a backup copy of this data base ?  (Y/N)';
  150.  TO N4
  151.   N4=UPPER(N4)
  152.   ENDDO
  153.   IF N4='Y'
  154.    ?
  155.    ?
  156.    ?'        Please place a FORMATTED diskette into drive "A."'
  157.    ?
  158.    ?
  159.    WAIT
  160.    DO DATABACK
  161.   ENDIF
  162.   CLEAR ALL
  163.   RUN CD\
  164.   SET COLOR TO
  165.   QUIT
  166.   CASE N4='E'
  167.     CLEAR
  168.     @ 5,0
  169.     ?'        This procedure restores files TO your fixed disk FROM one'
  170.     ?'        or more floppy diskettes.  ANY data base in the ISR-20'
  171.     ?'        system may now be restored.  This procedure also has been'
  172.     ?'        designed to reject most files which are foreign to the ISR-20'
  173.     ?'        system.'
  174.     ?
  175.     ?
  176.     ?
  177.     ?'        Please place your backup copy into drive "A" and press any'
  178.     ?
  179.     ?'        any key other than "RETURN" to continue.  Press "RETURN"'
  180.     ?
  181.    WAIT '        to abort this procedure and return to the menu.' TO N6
  182.     IF ASC(N6)=0
  183.      N4='Z'
  184.      LOOP
  185.     ENDIF
  186.     CLEAR
  187.     @ 5,36 SAY 'WORKING . . .'
  188.     CLOSE DATABASES
  189.     RUN RESTORE A: DATA*.*
  190.     RESTORE FROM DATANAME ADDITIVE
  191.     ?'All options and definitions for all the data bases were also restored.'
  192.     ?'If you have set options for any of the data bases since the time this'
  193.   ?'data base was backed up, you should also, at this time, restore the records'
  194.     ?'for any data base which was backed up at any time AFTER the last time you'
  195.     ?'changed the options for any of the data bases.'
  196.     ?
  197.     N4='K'
  198.     WAIT '               Press any key to continue . . .' TO N6
  199.     LOOP
  200.  ENDCASE
  201.  N4='Z'
  202. ENDDO
  203. RETURN
  204.